package com.kaledou.datapersistence.entity.usersystem;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import com.kaledou.domainobject.domain.entity.usersystem.Account;
import com.kaledou.domainobject.domain.entity.usersystem.FollowUserRelationship;
import com.kaledou.domainobject.domain.entity.usersystem.User;
import com.kaledou.domainobject.domain.entity.usersystem.UserInfo;

/**
 * 
 * @author WWJ
 * 
 */

@Entity
@Table(name = "KALEDOU_US_USER")
public class UserDB extends User {

	@Id
	@Column(name = "U_ID")
    @GeneratedValue(generator="foreigner")
    @GenericGenerator(name="foreigner",strategy="foreign",parameters={
                       @Parameter(name = "property",value="account")
    })
	@Override
	public Long getU_id() {
		return super.getU_id();
	}

	@Override
	public void setU_id(Long u_id) {
		super.setU_id(u_id);
	}

	@Column(name = "NAME", nullable = false)
	@Override
	public String getName() {
		return super.getName();
	}

	@Override
	public void setName(String name) {
		super.setName(name);
	}

	@Column(name = "NAMEPINYIN", nullable = false)
	@Override
	public String getNamePinYin() {
		return super.getNamePinYin();
	}

	@Override
	public void setNamePinYin(String namePinYin) {
		super.setNamePinYin(namePinYin);
	}

	@OneToOne(mappedBy = "user")
	@Override
	public UserInfo getUserInfo() {
		return super.getUserInfo();
	}

	@Override
	public void setUserInfo(UserInfo userInfo) {
		super.setUserInfo((UserInfoDB) userInfo);
	}

	@OneToMany(mappedBy = "user")
	@Override
	public List<FollowUserRelationship> getFollowerRelationship() {
		return super.getFollowerRelationship();
	}

	@Override
	public void setFollowerRelationship(
			List<FollowUserRelationship> followerRelationship) {
		super.setFollowerRelationship(followerRelationship);
	}

	@OneToMany(mappedBy = "user")
	@Override
	public List<FollowUserRelationship> getBeFollowedRelationship() {
		return super.getBeFollowedRelationship();
	}

	@Override
	public void setBeFollowedRelationship(
			List<FollowUserRelationship> beFollowedRelationship) {
		super.setBeFollowedRelationship(beFollowedRelationship);
	}

	@Column(name = "TAGNAMESPICED")
	@Override
	public String getTagName() {
		return super.getTagName();
	}

	@Override
	public void setTagName(String tagName) {
		super.setTagName(tagName);
	}

	@PrimaryKeyJoinColumn
	@Override
	public Account getAccount() {
		return super.getAccount();
	}

	@Override
	public void setAccount(Account account) {
		super.setAccount((AccountDB) account);
	}

}
